#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QProcess>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QPushButton>
#include <QLabel>
#include <QLineEdit>
#include <QCheckBox>

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

public slots:

    void updateBtnState();

    void slotShowClicked();
    void slotQueryClicked();
    void slotDownloadClicked();
    void slotInstallClicked();
    void slotPurgeClicked();

    void OnReadyReadAllStandardOutput();
    void OnReadyReadStandardError();
    void OnErrorOccurred(QProcess::ProcessError error);
    void OnDownloadFinishedSlot(int exitCode, QProcess::ExitStatus exitStatus);
    void OnInstallFinishedSlot(int exitCode, QProcess::ExitStatus exitStatus);
    void OnPurgeFinishedSlot(int exitCode, QProcess::ExitStatus exitStatus);
    
private:
    QProcess *m_process = nullptr;

    QLineEdit *m_lineEditName;
    QLineEdit *m_lineEditVersion;

    QPushButton *m_btnShow;
    QPushButton *m_btnQuery;
    QPushButton *m_btnDownload;
    QPushButton *m_btnInstall;
    QPushButton *m_btnPurge;

    QCheckBox *m_checkBox1;
    QCheckBox *m_checkBox2;

};
#endif // MAINWINDOW_H
